#!/bin/bash

a=(`cat a.txt`)
b=(`cat b.txt`)
for i in ${!a[@]}
do
	for j in ${!b[@]}
	do
		if [[ ${a[i]} == ${b[j]} ]]
		then
			echo "${a[i]}"
		fi
	done
done
